package edu.whut;

public class MathDemo {
    public static void main(String[] args) {
        System.out.println(Math.abs(-100));//获取绝对值

        System.out.println(Math.ceil(12.1));//向上取整
        System.out.println(Math.ceil(-12.1));//向上取整

        System.out.println(Math.floor(11.5));//向下取整
        System.out.println(Math.floor(-11.5));//向下取整

        System.out.println(Math.round(6.4));//四舍五入

        System.out.println(Math.max(10, 220));//返回最大值
        System.out.println(Math.min(10, 220));//返回最小值

        System.out.println(Math.pow(2, 3));//pow(x,y),返回x的y次幂

        System.out.println(Math.random());//产生[0.0 , 1.0)的小数
    }
}
